package com.javaweb.base;

public class BaseConfigMemory {
	
	public static long captchaExpireSecond = 180L;//图形验证码失效时间（秒）
	public static int captchaSize = 4;//图形验证码生成的字符串的长度
	public static String captchaRange = "23mN9P4wBKbpAaSRrT5s8XFDWnckMvyxCE7fGgHuVtYUe6dh";//图形验证码取值范围
	public static int shortMessageSize = 6;//短信验证码生成的字符串的长度
	public static String shortMessageRange = "0123456789";//短信验证码取值范围
	public static String repeatLoginHandle = "1";//是否允许同一账号重复登录（0：不允许；1：允许）
	public static long redistokenExpireMinutes = 30L;//token失效时间
	public static String initUserPassword = "abcd1234";//用户初始密码
	
	public static void refresh() {
		captchaExpireSecond = Long.parseLong(BaseSystemMemory.getConfigValueByKey("captcha.expire.second","180"));
		captchaSize = Integer.parseInt(BaseSystemMemory.getConfigValueByKey("captcha.size","4"));
		captchaRange = BaseSystemMemory.getConfigValueByKey("captcha.range","23mN9P4wBKbpAaSRrT5s8XFDWnckMvyxCE7fGgHuVtYUe6dh");
		shortMessageSize = Integer.parseInt(BaseSystemMemory.getConfigValueByKey("shortMessage.size","6"));
		shortMessageRange = BaseSystemMemory.getConfigValueByKey("shortMessage.range","0123456789");
		repeatLoginHandle = BaseSystemMemory.getConfigValueByKey("repeat.login.handle","1");
		redistokenExpireMinutes = Long.parseLong(BaseSystemMemory.getConfigValueByKey("redis.token.expire.minutes","30"));
		initUserPassword = BaseSystemMemory.getConfigValueByKey("init.user.password","abcd1234");
	}
	
}
